GtkActionBar: Implement destroy
authorMatthias Clasen <mclasen@redhat.com>
Wed, 19 Feb 2014 06:33:12 +0000 (01:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 19 Feb 2014 06:34:19 +0000 (01:34 -0500)
Similar to map/unmap, this needs to follow the actual
widget tree. Without this, several test cases in
the templates test fail.

gtk/gtkactionbar.c

index 012e4d10c9f320952aae82f6c0632ca36b720a6c..994a078be66d0ddafc702f6f772203915f08dafa 100644 (file)
@@ -155,6 +155,20 @@ gtk_action_bar_unmap (GtkWidget *widget)
   gtk_widget_unmap (priv->revealer);
 }
 
+static void
+gtk_action_bar_destroy (GtkWidget *widget)
+{
+  GtkActionBarPrivate *priv = gtk_action_bar_get_instance_private (GTK_ACTION_BAR (widget));
+
+  if (priv->revealer)
+    {
+      gtk_widget_destroy (priv->revealer);
+      priv->revealer = NULL;
+    }
+
+  GTK_WIDGET_CLASS (gtk_action_bar_parent_class)->destroy (widget);
+}
+
 static GType
 gtk_action_bar_child_type (GtkContainer *container)
 {
@@ -220,6 +234,7 @@ gtk_action_bar_class_init (GtkActionBarClass *klass)
   widget_class->hide = gtk_action_bar_hide;
   widget_class->map = gtk_action_bar_map;
   widget_class->unmap = gtk_action_bar_unmap;
+  widget_class->destroy = gtk_action_bar_destroy;
 
   container_class->add = gtk_action_bar_add;
   container_class->remove = gtk_action_bar_remove;